import { TXMapApi } from '@/common/constants'

const key = import.meta.env.HOPE_TX_MAP_KEY

/**
 * 地址转换为经纬度
 * @param address 地址
 * @returns
 */
export const useAddressToCoder = async (address: string) => {
  const { result: { location } } = await useRequest({
    method: 'GET',
    url: TXMapApi.ADDRESS_TO_CODER,
    data: {
      address,
      key,
    },
  }) as any

  return location
}
